#ifndef __ERRORS_H__
#define __ERRORS_H__

#include "redobject.h"

typedef enum _error_t
{
	e_ok,
	e_tokenizer,
	e_token_expected,
	e_case_default_expected,
	e_case_duplicated,
	e_case_eof,
	e_default_duplicated,
	e_op_expected,
	e_invalid_op,
	e_const_expected,
	e_outside_break,
	e_outside_return,
	e_outside_continue,
	e_identifier_expected,
	e_keyword_expected,
	e_keyword_unexpected,
	e_range_expected,
	e_illegal_delete,
	e_duplicate_finally,
	e_duplicate_except_all,
	e_only_named_func,
	e_only_anonymous_func,
	e_assign_constant,
} error_type_t;

RED_EXPORT void errors_throw(error_type_t code, const char *fmt, ...) __attribute__ ((__format__(__printf__, 2, 3)));

RED_EXPORT error_type_t errors_code();
RED_EXPORT const char *errors_message();

#endif /* __ERRORS_H__ */
